<!DOCTYPE html>
<html>
	<head>
	<meta charset="utf-8">
	<title>健康方案</title>
	<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">		
	<link rel="stylesheet" href="css/mui.min.css">
	<link rel="stylesheet" href="css/grandeHealth.css">
	<link rel="stylesheet" type="text/css" href="css/myList.css"/>
	<link rel="stylesheet" type="text/css" href="css/modelManager.css"/>
	<style>
		
		  .mui-active{
		  	    color: #007aff;
		  } 
		  
		  .oy-mui-table{
		  	height: 50px;
		  	line-height: 50px;
		  	background-color: #fff;
		  	font-size: 17px;
		  	color: rgb(162,171,179);
		  	
		  }
		 .mui-table-cell{
			text-align: center;
		    white-space: nowrap;
		    text-overflow: ellipsis;
		    overflow: hidden;
		    color: rgb(162,171,179);
		   font-size: 17px;
		    
		}
		  .mui-active{
		  	color: rgb(44,143,255);
		  }
	</style>
	</head>
	<body>
		<!--<header>class="mui-bar mui-bar-nav" style="display: block;height: 64px;padding-top:20px">
	      <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	      <h1 class="mui-title">模板管理</h1>
	    </header>-->
	    <div class="mui-content">
	    	<div class="mui-table oy-mui-table">
		    	<div class="mui-table-cell mui-active" data-href="healthProgram.html" id="headlth">
		    		健康方案
		    	</div>
		    	<div class="mui-table-cell" data-href="attentionCase.html" id="attention">
		    		注意事项
		    	</div>
		    </div>
		 </div>
		<script src="js/jquery-1.7.2.min.js"></script>
		<script src="js/mui.min.js"></script>
		<script src="js/grandeHealth.js"></script>
		<script src="js/medicalRecord.js"></script>
		<script>
				 //mui初始化
			mui.init();
			var subpages = ['healthProgram.html', 'attentionCase.html'];
			var subpage_style = {
				top: '120px',
				bottom: '0px'
			};
			
			var aniShow = {};
			
			 //创建子页面，首个选项卡页面显示，其它均隐藏；
			mui.plusReady(function() {
				var self = plus.webview.currentWebview();
				for (var i = 0; i < 2; i++) {
					var temp = {};
					var sub = plus.webview.create(subpages[i], subpages[i], subpage_style);
					if (i > 0) {
						sub.hide();
					}else{
						temp[subpages[i]] = "true";
						mui.extend(aniShow,temp);
					}
					self.append(sub);
				}
			});
			 //当前激活选项
			var activeTab = subpages[0];
			// title = document.getElementById("title");
			 //选项卡点击事件
			mui('body').on('tap', '.mui-table-cell', function(e) {
				$(this).addClass("mui-active").siblings().removeClass("mui-active");
				var targetTab = this.getAttribute('data-href');
				if (targetTab == activeTab) {
					return;
				}
				//更换标题
				//title.innerHTML = this.querySelector('.mui-tab-label').innerHTML;
				//显示目标选项卡
				//若为iOS平台或非首次显示，则直接显示
				if(mui.os.ios||aniShow[targetTab]){
					plus.webview.show(targetTab);
				}else{
					//否则，使用fade-in动画，且保存变量
					var temp = {};
					temp[targetTab] = "true";
					mui.extend(aniShow,temp);
					plus.webview.show(targetTab,"fade-in",300);
				}
				//隐藏当前;
				plus.webview.hide(activeTab);
				//更改当前活跃的选项卡
				activeTab = targetTab;
			});
			//刷新数据
			
			/*document.addEventListener('gohome', function() {
				var defaultTab = document.getElementById("attention");
				//模拟首页点击
				location.reload(true);
				//mui.trigger(defaultTab, 'tap');
				
			})*/
	    </script>	
	</body>
</html>


